package com.socodethis.spaceex;

import com.badlogic.gdx.graphics.g2d.Sprite;
import com.socodethis.spaceex.math.cPoint;

public class GameUIClass {
	private texturePackerLoader tGameUI = new texturePackerLoader("data/ui_gamescreen_icons.txt","data/ui_gamescreen_icons.png",0);
	private Sprite icon, bar;
	private Sprite[] arrows;
	private float leftX,rightX,bottomY,topY;
	private int i;
	public GameUIClass(){
	}
	public void setBox(cPoint dimensions, int lives){
		String icon_name = "cat_icon" + lives;
		icon = new Sprite(tGameUI.getName(icon_name));
		bar = new Sprite(tGameUI.getName("bar_icon01"));
		icon.setSize(1, 1);
		bar.setSize(1, 1);
		icon.setPosition(-dimensions.getX()/2 + icon.getWidth()/4, dimensions.getY()/3.5f);
		bar.setPosition(-dimensions.getX()/2+icon.getWidth() + icon.getWidth()/4, dimensions.getY()/3.5f);
	}
	public void setArrows(cPoint dimensions, Sprite[] arrows){
		for(Sprite arrow:arrows){
			arrow.setSize(1, 1);
		}
		leftX = -dimensions.getX()/2;
		rightX = dimensions.getX()/2 - (arrows[0].getWidth());
		bottomY = -dimensions.getY()/3 - (arrows[0].getHeight());
		topY = dimensions.getY()/3;
		
		
		arrows[0].setPosition(leftX,topY);
		arrows[1].setPosition(leftX,bottomY);
		arrows[2].setPosition(rightX,topY);
		arrows[3].setPosition(rightX,bottomY);
		this.arrows = new Sprite[arrows.length];
		for(i = 0; i < arrows.length; i++){
			this.arrows[i] = new Sprite(arrows[i]);
		}
	}
	public Sprite getBar(){
		return bar;
	}
	public Sprite getIcon(){
		return icon;
	}
	public Sprite[] getArrows(){
		return arrows;
	}
	
}
